#pragma once
#include "stdafx.h"

namespace Network
{
	class SOCK_Stream {
	public:
		SOCK_Stream() : handle_ (INVALID_SOCKET) { }
		SOCK_Stream(SOCKET h) : handle_ (h) { }
		
		~SOCK_Stream() { 
			closesocket(handle_); 
		};

		void set_handle (SOCKET h) {
			handle_ = h; 
		};
		
		SOCKET get_handle() const { 
			return handle_; 
		};

		int send(const char *buffer, size_t buffer_size, int flags);
		int receive(void *buffer, size_t buffer_size, int flags);
		void close();
	private:
		SOCKET handle_;
	};

}